import axios from "axios";
import messageBox from "@/utils/message-box";

const ins = axios.create(); // * 创建 axios 实例

ins.interceptors.response.use(function (resp) {
    if (resp.data.code !== 0) {
        console.log(resp)
        messageBox(
            resp.data.msg,
            "error",
            undefined,
            1900,
            null
        );
        return null;
    }
    return resp.data.data;
})

export default ins;